package net.lovedna.command {
	import lovedna.framework.mvcs.Command;

	import net.lovedna.command.messages.LoginCommand;
	import net.lovedna.config.MessageConfig;
	import net.lovedna.data.messages.MessageError;
	import net.lovedna.data.messages.MessageLogin;

	/**
	 * @author lee
	 */
	public class MapMessageProtocolCommand extends Command {
		[Inject]
		public var _messageConfig : MessageConfig;

		public function MapMessageProtocolCommand() {
			super();
		}

		override public function execute() : void {
			addMessage(2, MessageLogin, LoginCommand);
			addMessage(65535, MessageError);
		}

		private function addMessage(protocol : int, msg : Class, command : Class = null) : void {
			_messageConfig.add(protocol, msg, command);
		}
	}
}
